package com.ruoyi.project.hissystem.service.impl;

import com.ruoyi.project.hissystem.domain.HisUser;
import com.ruoyi.project.hissystem.mapper.HisUserMapper;
import com.ruoyi.project.hissystem.service.HisUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : 杨磊
 * @date : 14:45 2021/8/18
 */
@Service
public class HisUserServiceImpl implements HisUserService {

    //声明mapper层属性
    @Autowired
    private HisUserMapper hisUserMapper;

    /**
     * 1.根据条件分页查询用户列表
     *
     * @param hisUser
     * @return
     */
    @Override
    public List<HisUser> selectUserList(HisUser hisUser) {
        return hisUserMapper.selectUserList(hisUser);
    }

    /**
     * 2.通过用户名查询用户
     * @param userName 用户名
     * @return
     */
    @Override
    public HisUser selectUserByUserName(String userName) {
        return hisUserMapper.selectUserByUserName(userName);
    }

    /**
     * 3.新增用户信息
     * @param hisUser 用户信息
     * @return
     */
    @Override
    public int insertUser(HisUser hisUser) {
        return hisUserMapper.insertUser(hisUser);
    }

    /**
     * 4.通过用户ID查询用户
     * @param userId 用户ID
     * @return
     */
    @Override
    public HisUser selectUserById(Long userId) {
        return hisUserMapper.selectUserById(userId);
    }

    /**
     * 5.修改用户信息
     * @param hisUser 用户信息
     * @return
     */
    @Override
    public int updateUser(HisUser hisUser) {
        return hisUserMapper.updateUser(hisUser);
    }

    /**
     * 6.批量删除用户信息
     * @param userIds 需要删除的用户ID
     * @return
     */
    @Override
    public int deleteUserByIds(Long[] userIds) {
        return hisUserMapper.deleteUserByIds(userIds);
    }


}
